<template>
    <div class="systemSettings">
        <h2 class="my-big-font">新增管理员</h2>
        <div class="systemSettings-content">
            <div class="input-box">
                <span class="title">
                    <i>*</i>
                    登录密码
                </span>
                <input class="content-inp" type="password" name="" id="" v-model="user.password">
                <span class="prompt" v-show="false">请输入正确的密码</span>
            </div>
            <div class="input-box">
                <span class="title">
                    <i>*</i>
                    确认密码
                </span>
                <input class="content-inp" type="password" name="" id="" v-model="upwdData2">
                <span class="prompt" v-show="false">请输入相同的密码</span>
            </div>
            <div class="input-box">
                <span class="title">
                    <i>*</i>
                    用户名称
                </span>
                <input class="content-inp" type="text" name="" id="" v-model="user.name">
                <span class="prompt" v-show="false">请输入正确用户名</span>
            </div>
            <div class="input-box">
                <span class="title">
                    <i>*</i>
                    手机号
                </span>
                <input class="content-inp" type="text" name="" id="" v-model="user.phone">
                <span class="prompt" v-show="false">请输入正确手机号</span>
            </div>
            <!-- 单选 -->
            <div class="input-box">
                <span class="title">
                    <i>*</i>
                    账号状态
                </span>
                <el-radio v-model="user.state" label="1">启用</el-radio>
                <el-radio v-model="user.state" label="2">禁用</el-radio>
                <span class="prompt" style="color:#999;">禁用状态下账号无法登录后台</span>
            </div>
        </div>
        <div class="btn-box">
            <span class="my-btn btn1" @click="submitClick">保存</span>
            <span class="my-btn btn2" @click="cancel">取消</span>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            user: {
              state: '',//账号状态
              password:'',//密码
              name:'',//用户名
              phone:'',//手机号
            },
            upwdData2:'',//密码2
        }
    },
    methods:{
        //提交
        submitClick(){
            if(this.user.password==this.upwdData2){
              this.axios.post("/recharge/sys/user/save",this.user).then(result=>{
                this.$alert("添加成功")
                this.$router.push('/index/administratorManage')
              })
            }else {
              this.$alert("请输入相同的密码")
            }
        },
        //取消
        cancel(){
            this.$router.push('/index/administratorManage')
        }
    }
}
</script>

<style scoped>
.systemSettings{
    padding: 30px 82px 50px 30px;
    background: #fff;
    margin: 10px 0 0 10px;
    color: #333333;
    min-height: calc(100vh - 96px);
}
.systemSettings h2{
    padding-top: 0;
}
/* 内容 */
.systemSettings-content{
    margin-top: 30px;
    padding-bottom: 60px;
    border-bottom:1.5px solid #ccc ;
}
.input-box{
    min-height: 65px;
    position: relative;
}
.input-box .title{
    width: 97px;
    display: inline-block;
}
.input-box .title i{
    color: red;
    font-weight: 600;
}
/* input框 */
.input-box input{
    min-width: 300px;
    height: 35px;
    background: #fff!important;
    border: 0;
    box-shadow: 2px 2px 6px 1px #ddd;
    padding: 8px;
}
/* 提示信息 */
.prompt{
    color: red;
    position: absolute;
    bottom: 0;
    left: 92px;
    font-size: 15px;
}
.systemSettings .btn-box{
    padding: 30px 40px;
}
.systemSettings .btn-box span{
    width: 110px;
    height: 35px;
    line-height: 35px;
    border-radius: 5px;
    border: 0;
    margin-right: 40px;
}
.systemSettings .btn-box .btn2{
    background: #ddd;
    color: #fff;
}
</style>